import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  //引入view里面的文件

  {
    path:"/",
    name:"Main",
    component:() => import("../views/Main.vue"),
    children:[
      {
        //根据路由名称跳转到main哪里
        path:"home",
        alias:"",
        name:"Home",
        component:() => import('../views/Home.vue'),
        children:[
          {
            // path:'/attention/:pid?/:city',
            path:"attention",
            alias:"",
            name:"Attention",
            component:() => import ("../views/Attention.vue"),
            
          },
          {
            path:"recommend",
            name:"Recommend",
            component:() => import ("../views/Recommend.vue"),
            
          },
          {
            // path:'/note/:pid?/:city',
            path:"note",
            name:"Note",
            component:() => import ("../views/Note.vue"),
            
          },
          {
            path:"video",
            name:"Video",
            component:() => import ("../views/Video.vue"),
            
          },
          {
            path:"activity",
            name:"Activity",
            component:() => import ("../views/Activity.vue"),
            
          },
          {
            path:"motherAndbaby",
            name:"MotherAndbaby",
            component:() => import ("../views/MotherAndbaby.vue"),
            
          },
          {
            path:"kitchen",
            name:"Kitchen",
            component:() => import ("../views/Kitchen.vue"),
            
          },
          {
            path:"bake",
            name:"Bake",
            component:() => import ("../views/Bake.vue"),
            
          },
          {
            path:"solarterms",
            name:"Solarterms",
            component:() => import ("../views/Solarterms.vue"),
            
          },
        ]
      },
      {
        path:"category",
        name:"Category",
        component:() => import ("../views/Category.vue"),
        children:[
          {
            path:"tuijian",
            alias:"",
            name:"Tuijian",
            component:() => import ("../views/Tuijian.vue"),
            
          },
          {
            path:"shouji",
            name:"Shouji",
            component:() => import ("../views/Shouji.vue"),
            
          },
        ]
      },
      {
        //给他一个参数 携带路由参数pid 另一个在find那边 跳转的时候也要携带参数 这个参数可以传递打印出来
        //  可以传可不传 加?号表示
        
        // path:"/detail/:pid?", 
        // 另一个跳转
        //要加冒号才是路由参数
        //这里要两个参数才能跳转
        // path:'/detail/:pid/:city',
        
        // path:'/detail/:pid?/:city',
        path:'/detail/:pid?/:city',
        name:"Detail",
        component:() => import("../views/Detail.vue")
      },
     
      {
        path:"find",
        name:"Find",
        component:() => import("../views/find.vue")
      },
      {
        path: 'shopcart',
        name: 'Shopcart',
        component: () => import('../views/Shopcart.vue')
      },
      {
        path: 'my',
        name: 'My',
        component: () => import('../views/My.vue')
      }
    ]
    
  },
  {
    path:"/tiaoz",
    name:"Tiaoz",
    component:() => import("../views/Tiaoz.vue")
  },
  {
    path:"/seatiaoz",
    name:"Seatiaoz",
    component:() => import("../views/Seatiaoz.vue"),
  },
  {
    path:"/cliseatex",
    
    name:"Cliseatex",
    component:() => import ("../views/Cliseatex.vue"),
    children:[
      {
        path:"caipu",
        alias:"",
        name:"Caipu",
        component:() => import ("../views/Caipu.vue"),
        
      },
      
      {
        path:"biji",
        name:"Biji",
        component:() => import ("../views/Biji.vue"),
        
      }, 
      {
        path:"yonghu",
        name:"Yonghu",
        component:() => import ("../views/Yonghu.vue"), 
      },
      {
        path:"shangp",
        name:"Shangp",
        component:() => import ("../views/Shangp.vue"), 
      },
      {
        path:"ketang",
        name:"Ketang",
        component:() => import ("../views/Ketang.vue"), 
      },      
    ],

  },
  {
    path:"caiputzh",
    alias:"",
    name:"Caiputzh",
    component:() => import ("../views/Caiputzh.vue"),
    
  },
  {
    path:"/menu",
    name:"Menu",
    component:() => import("../views/Menu.vue")
  },
  {
    path:"/logo",
    name:"Logo",
    component:() => import("../views/Logo.vue")
  },
  {
    path:"/shicaixqin",
    name:"Shicaixqin",
    component:() => import("../views/Shicaixqin.vue")
  },
]

const router = new VueRouter({
  routes
})

export default router